import socket

client = socket.socket()

client.connect(("localhost", 8888))

client.send("nihao".encode("UTF-8"))

result = client.recv(1024).decode("UTF-8")

print(f"接收到服务端的消息：{result}")

client.close()